your personal website on atproto - mirror blento.app
at fix-cached-posts 18 lines 577 B view raw
1import { createCache } from '$lib/cache'; 2import { loadData } from '$lib/website/load.js'; 3import { env } from '$env/dynamic/private'; 4import { error, json } from '@sveltejs/kit'; 5import { getActor } from '$lib/actor'; 6 7export async function GET({ params, platform, request }) { 8 const cache = createCache(platform); 9 if (!cache) return json('no cache'); 10 11 const actor = await getActor({ request, paramActor: params.actor, platform, blockBoth: false }); 12 13 if (!actor) { 14 throw error(404, 'Page not found'); 15 } 16 17 return json(await loadData(actor, cache, true, 'self', env)); 18}